﻿using NP.BPMReportPlatform.AnalysisInstance.Dtos;
using NP.BPMReportPlatform.BaseData.Dto;
using NP.BPMReportPlatform.Common.Dtos;
using NP.BPMReportPlatform.Contract.Dtos;
using NP.BPMReportPlatform.Entities.BPM_Platform;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
using static NP.BPMReportPlatform.Contract.Dtos.ContractEnum;

namespace NP.BPMReportPlatform.Common
{
    public interface ICommonService : IApplicationService
    {
        /// <summary>
        /// 根据条件查询甲方
        /// </summary>
        /// <param name="searchDto"></param>
        /// <returns></returns>
        Task<PagedResultDto<ItemPairDto>> GetAllCorporateList(CommonSearchDto searchDto);

        /// <summary>
        /// 根据条件查询城市数据
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        Task<List<TreeNodes>> GetAllCities(string name);

        /// <summary>
        /// 获取对应人员的权限下的人员
        /// </summary>
        /// <param name="workNumber"></param>
        /// <param name="type">权限类别</param>
        /// <param name="ignoreAdmin">忽略admin权限</param>
        /// <returns></returns>
        List<string> GetUserByRoleFilter(string workNumber, RelationshipTypeEnum type, bool ignoreAdmin = false);

        /// <summary>
        /// 获取指定人对应的HRBP角色人
        /// </summary>
        /// <param name="workNumber"></param>
        /// <param name="type">忽略admin权限</param>
        /// <returns></returns>
        public List<string> GetUserHRBPFilter(string workNumber, RelationshipTypeEnum type);

        /// <summary>
        /// 获取字典表
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        Task<PagedResultDto<Dictionaries>> GetKeyValues(GetKeyValuesInput input);

        /// <summary>
        /// 发送邮件
        /// </summary>
        /// <param name="emailType">邮件类型</param>
        /// <param name="userName">人员姓名</param>
        /// <param name="workNumber">工号</param>
        /// <param name="contractCode">合同编码</param>
        /// <returns></returns>
        Task SendEmail(ContractEmailTypeEnum emailType, string userName, string workNumber, string contractCode);

        /// <summary>
        /// 立邦企业微信通用通知消息WebAPI接口
        /// </summary>
        /// <param name="title">消息标题</param>
        /// <param name="message">消息内容</param>
        /// <param name="url">消息url</param>
        /// <param name="users">企业微信账户，多个用单竖线分割（不是工号）</param>
        /// <returns></returns>
        Task MsgSendForAPI(string title, string message, string url, string users);

        /// <summary>
        /// 模板导出
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        Task<MemoryStream> ExportTemplate(string name);

        Task<List<ActivitieTaskModel>> GetInstancesSteps(string[] instanceNumber);
    }
}
